package com.parking.mgr.common.exception.enums;


import com.parking.mgr.common.annotion.ExpEnumType;
import com.parking.mgr.common.constant.SysExpEnumConstant;
import com.parking.mgr.common.factory.ExpEnumCodeFactory;

/**
 * @ClassName DeleteUpdateExceptionEnums
 * @Description 删除更新操作相关异常枚举
 * @Auther: shilintao
 * @Date: 2023/7/1
 */
@ExpEnumType(module = SysExpEnumConstant.SYS_MODULE_EXP_CODE,kind = SysExpEnumConstant.SYS_COMMON_EXCEPTION_ENUM)
public enum DeleteUpdateExceptionEnums implements IBaseExceptionEnum {

    CAN_NOT_DELETE(1,"该项不可删除"),
    I18N_MESSAGE_CAN_NOT_DELETE(1,"i18n_message_can_not_delete"),

    CAN_NOT_UPDATE(2,"该项不可编辑"),
    I18N_MESSAGE_CAN_NOT_UPDATE(2,"i18n_message_can_not_update"),

    CAN_NOT_DELETE_EXIST_CHILD_NODE(3,"存在子节点，不能删除"),
    I18N_MESSAGE_CAN_NOT_DELETE_EXIST_CHILD_NODE(3, "i18n_message_can_not_delete_exist_child_node");

    private final Integer code;

    private final String message;

    DeleteUpdateExceptionEnums(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return ExpEnumCodeFactory.getExpEnumCode(this.getClass(),code);
    }

    @Override
    public String getMessage() {
        return message;
    }
}
